package com.yonyou.train.algorithem;


import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class MD5_Algorithem {
    public static final String KEY_MD5 = "MD5";

    /**
     * MD5加密
     */
    public static byte[] encryptMD5(byte[] data) throws NoSuchAlgorithmException {
        if (data == null) {
            return null;
        }
        MessageDigest md5 = MessageDigest.getInstance(KEY_MD5);
        md5.update(data);
        return md5.digest();
    }
}
